home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / texinfo / fixfonts < prev    next >
Text File  |  1992-05-13  |  2KB  |  92 lines

  1. #!/bin/sh
  2. # Make links named `lcircle10' for all TFM and GF/PK files, if no
  3. # lcircle10's already exist.
  4.  
  5. # Don't override definition of prefix and/or libdir if they are
  6. # already defined in the environment. 
  7. if [ ! "${prefix}" ]; then
  8.   prefix=/usr/local
  9. else
  10.   # prefix may contain references to other variables, thanks to make.
  11.   eval prefix="${prefix}"
  12. fi
  13.  
  14. if [ ! "${libdir}" ]; then
  15.   libdir="${prefix}/lib/tex"
  16. else
  17.   # libdir may contain references to other variables, thanks to make.
  18.   eval libdir="${libdir}"
  19. fi
  20.  
  21. texlibdir="${libdir}"
  22. texfontdir="${texlibdir}/fonts"
  23.  
  24. # Directories for the different font formats, in case they're not all
  25. # stored in one place.
  26. textfmdir="${texfontdir}"
  27. texpkdir="${texfontdir}"
  28. texgfdir="${texfontdir}"
  29.  
  30. if [ ! "${TMPDIR}" ]; then
  31.    TMPDIR="/tmp"
  32. fi
  33.  
  34. tempfile="${TMPDIR}/circ$$"
  35. tempfile2="${TMPDIR}/circ2$$"
  36.  
  37. # Find all the fonts with names that include `circle'.
  38. cd "${texfontdir}"
  39. find . -name '*circle*' -print > "${tempfile}"
  40.  
  41. # If they have lcircle10.tfm, assume everything is there, and quit.
  42. if grep -s lcircle10.tfm "${tempfile}"
  43. then
  44.   echo "Found lcircle10.tfm."
  45.   rm -f "${tempfile}"
  46.   exit 0
  47. fi
  48.  
  49. # No TFM file for lcircle.  Make a link to circle10.tfm if it exists,
  50. # and then make a link to the bitmap files.
  51. if grep circle10.tfm "${tempfile}" > "${tempfile2}"
  52. then
  53.   # We found circle10.tfm.  Continue below.
  54.   true
  55. else
  56.   # No circle10.tfm.  Give up.
  57.   echo "I can't find any circle fonts in ${texfontdir}."
  58.   echo "If it isn't installed somewhere else, you need"
  59.   echo "to get the Metafont sources from somewhere, e.g.,"
  60.   echo "labrea.stanford.edu:pub/tex/latex/circle10.mf,"
  61.   echo "and run Metafont on them."
  62.   rm -f ${tempfile}
  63.   exit 1
  64. fi
  65.  
  66. # We have circle10.tfm.  (If we have it more than once, take the first
  67. # one.)  Make the link.
  68. ln `head -1 "${tempfile2}"` "${textfmdir}/lcircle10.tfm"
  69. echo "Linked to `head -1 ${tempfile2}`."
  70.  
  71. # Now make a link for the PK files, if any.
  72. grep 'circle10.*pk' "${tempfile}" > "${tempfile2}"
  73. cd "${texpkdir}"
  74. for f in `cat ${tempfile2}`
  75. do
  76.   ln "$f" `dirname "$f"`/l`basename "$f"`
  77.   echo "Linked to $f."
  78. done
  79.  
  80. # And finally for the GF files.
  81. grep 'circle10.*gf' "${tempfile}" > "${tempfile2}"
  82. cd "${texgfdir}"
  83. for f in `cat "${tempfile2}"`
  84. do
  85.   ln "$f" `dirname "$f"`/l`basename "$f"`
  86.   echo "Linked to $f."
  87. done
  88.  
  89. rm -f "${tempfile}" "${tempfile2}"
  90.  
  91. # eof
  92.